<?php


namespace app\api\controller;


use app\common\controller\Api;
use app\common\model\Category as CategoryModel; ;
use think\Request;


class Category extends Api
{
    protected $noNeedLogin = ['*'];

    public function list(Request $request)
    {

        $type = $request->get('type');

        $where['type'] = $type;
        $where['status'] = 'normal';

        $list = CategoryModel::where($where)->field('image,nickname as page,name')->limit(6)->order('weigh asc')->select() ;

        $this->success('分类',$list,200);
    }
}
